﻿function popupMess(strResult) {
    var strHtml = '';
    strHtml = '<div id="divPopupSignIn" class="div_PopupSignin" style="width:380px;">' +
	'<i class="div_tlHelp"></i>' +
    '<div class="div_ctHelp" id="divPopupTitle"><i class="divLogoSignin"></i><strong>' + langSI()[0][6] + '</strong></div>' +
     '<i class="div_trHelp"></i>' +
     '<div class="div_clHelp">' +
     	'<div class="div_crHelp">' +
        	'<div class="div_BodySignin ">' +
        	 '<div class="div_MainPBSI" id="divPopupSignInInner">' +
                 '<p style="clear: both; padding:20px 0;width:auto;" class="pMessDK pMessFail"><i class="iMessDK"></i><span style="width:auto" class="spMessDK">' + strResult + '</span></p>' +
                 '<span style="display:block;height:1px;width:1px;clear:both"></span>' +
                '</div>' +
            '</div>' +
        '</div>' +
     '</div>' +
     '<i class="div_blHelp"></i>' +
    '<i class="div_cbHelp"></i>' +
     '<i class="div_brHelp"></i>' +
     '<div class="div_Close" id="div_CloseWI"></div>' +
    '</div>';
    return strHtml;
}
function popupMessOk(strResult) {
    var strHtml = '';
    strHtml = '<div id="divPopupSignIn" class="div_PopupSignin" style="width:380px;">' +
	'<i class="div_tlHelp"></i>' +
    '<div class="div_ctHelp" id="divPopupTitle"><i class="divLogoSignin"></i><strong>' + langSI()[0][6] + '</strong></div>' +
     '<i class="div_trHelp"></i>' +
     '<div class="div_clHelp">' +
     	'<div class="div_crHelp">' +
        	'<div class="div_BodySignin ">' +
        	 '<div class="div_MainPBSI" id="divPopupSignInInner">' +
                 '<p style="clear: both; padding:20px 0;width:auto;" class="pMessDK"><i class="iMessDK"></i><span style="width:auto" class="spMessDK">' + strResult + '</span></p>' +
                 '<span style="display:block;height:1px;width:1px;clear:both"></span>' +
                '</div>' +
            '</div>' +
        '</div>' +
     '</div>' +
     '<i class="div_blHelp"></i>' +
    '<i class="div_cbHelp"></i>' +
     '<i class="div_brHelp"></i>' +
     '<div class="div_Close" id="div_CloseWI"></div>' +
    '</div>';
    return strHtml;
}
function popupMessDeal(strResult) {
    var strHtml = '';
    strHtml = '<div id="divPopupSignIn" class="div_PopupSignin" style="width:380px;">' +
	'<i class="div_tlHelp"></i>' +
    '<div class="div_ctHelp" id="divPopupTitle"><i class="divLogoSignin"></i><strong>' + langSI()[0][6] + '</strong></div>' +
     '<i class="div_trHelp"></i>' +
     '<div class="div_clHelp">' +
     	'<div class="div_crHelp">' +
        	'<div class="div_BodySignin ">' +
        	 '<div class="div_MainPBSI" id="divPopupSignInInner" style="width:510px;padding-right:0px">' +
                 '<p style="clear: both; padding:20px 0;width:auto;" class="pMessDK pMessFail"><span style="width:auto;color:#93BC46" class="spMessDK">' + strResult + '</span></p>' +
                 '<span style="display:block;height:1px;width:1px;clear:both"></span>' +
                '</div>' +
            '</div>' +
        '</div>' +
     '</div>' +
     '<i class="div_blHelp"></i>' +
    '<i class="div_cbHelp"></i>' +
     '<i class="div_brHelp"></i>' +
     '<div class="div_Close" id="div_CloseWI"></div>' +
    '</div>';
    return strHtml;
}
function popupLostPass() {
    var strHtml = '';
    strHtml = '<div class="div_PopupSignin">' +
	'<i class="div_tlHelp"></i>' +
    '<div class="div_ctHelp"><i class="divLogoSignin"></i><strong>' + langSI()[0][2] + '</strong></div>' +
     '<i class="div_trHelp"></i>' +
     '<div class="div_clHelp">' +
     	'<div class="div_crHelp">' +
        	'<div class="div_BodySignin ">' +
        	 '<div class="div_MainPBSI">' +
            	'<p class="ptextSE styleText2">' + langSI()[0][8] + '</p>' +
            	'<div class="div_EmailRePass">' +
            	 '<p class="styleText15 pTextWI " style="padding-top:14px">' + langSI()[0][3] + ':</p>' +
                        '<div class="txt_Signin">' +
                            '<div class="txtSigninPopup txtfocus">' +
                            		'<div class="txt_tlW"></div>' +
                                	'<div class="txt_ctW"></div>' +
                                	'<div class="txt_trW"></div>' +
                                	'<div class="txt_clW">' +
					                    '<div class="txt_crW">' +
						                    '<div class="txt_inner">' +
							                    '<input type="text" id="txtForgotPass" />' +
						                    '</div>' +
					                    '</div>' +
			                  	'</div>' +
                                '<div class="txt_blW"></div>' +
                                '<div class="txt_cbW"></div>' +
                                '<div class="txt_brW"></div>' +
                            '</div>' +
                            '<div class="btnCheckEWI"><a id="btnSendPass" href="test" class="btnGui">' + langSI()[0][7] + '</a></div>' +
                       '</div>' +
                '</div>' +
                 '<p class="styleText10 color10 pMessSI1" id="pMessLostPass"></p>' +
    //'<p class="styleText10 color20 pMessSI1"><em>Bạn chưa là thành viên,mời bạn nhập mật khẩu để tiến hành đang ký nhanh.</em></p>'+
                '</div>' +
            '</div>' +
        '</div>' +
     '</div>' +
    ' <i class="div_blHelp"></i>' +
    '<i class="div_cbHelp"></i>' +
     '<i class="div_brHelp"></i>' +
     '<div class="div_Close" id="div_CloseWI"></div>' +
    '</div>';
    return strHtml;
}

function popupSignIn() {
    var strHtml = '';
    strHtml = '<div id="divPopupSignIn" class="div_PBodySI">' +
    '<i class="div_tlHelp"></i>' +
        '<div class="div_ctHelp"><i class="divLogoSignin"></i><strong>' + langSI()[0][5] + '</strong>' +
            '<div class="div_iconDNSI"><a class="a_DNYahoo" href="#"></a><a class="a_DNGoogle" href="#"></a><a class="a_DNFace" href="#"></a></div>' +
        '</div>' +
         '<i class="div_trHelp"></i>' +
         '<div class="div_clHelp">' +
     	    '<div class="div_crHelp">' +
     	        '<div class="div_BodySignin">' +
        	        '<div class="div_MainPBSI1">' +
            	    '<ul class="ul_PopupSignin">' +
                	    '<li>' +
                    	    '<p class="ptxtSignin"><strong class="styleText15">' + langSI()[0][3] + ':</strong></p>' +
                            '<div class="txtSigninPopup txtfocus">' +
                            		    '<div class="txt_tlW"></div>' +
                                	    '<div class="txt_ctW"></div>' +
                                	    '<div class="txt_trW"></div>' +
                                	    '<div class="txt_clW">' +
					                        '<div class="txt_crW">' +
						                        '<div class="txt_inner txt_Product">' +
							                        '<input type="text" id="txtPEMail"/>' +
						                        '</div>' +
					                        '</div>' +
			                  	    '</div>' +
                                    '<div class="txt_blW"></div>' +
                                    '<div class="txt_cbW"></div>' +
                                    '<div class="txt_brW"></div>' +
                             '</div>' +
                        '</li>' +
                        '<li>' +
                    	    '<p class="ptxtSignin"><strong class="styleText15">' + langSI()[0][4] + ':</strong></p>' +
                            '<div class="txtSigninPopup">' +
                            		    '<div class="txt_tlW"></div>' +
                                	    '<div class="txt_ctW"></div>' +
                                	    '<div class="txt_trW"></div>' +
                                	    '<div class="txt_clW">' +
					                        '<div class="txt_crW">' +
						                        '<div class="txt_inner txt_Product">' +
							                        '<input type="password" id="txtPPass"/>' +
						                        '</div>' +
					                        '</div>' +
			                  	    '</div>' +
                                    '<div class="txt_blW"></div>' +
                                    '<div class="txt_cbW"></div>' +
                                    '<div class="txt_brW"></div>' +
                             '</div>' +
                            '<a id="btnPLostPass" class="styleText4 aNotRePassPopup" href="notReSpass"><strong>' + langSI()[0][2] + '</strong></a>' +
                        '</li>' +
                          '<li class="liCheckReSigninPopup">' +
                    	    '<p class="ptxtSignin"></p>' +
                            '<div class="txtSigninPopup" id="divPRemem" >' +
                        	    '<div class="div_cbReSignin"><i class="iRePSI"></i></div><p class="p_CbReSignin styleText11">' + langSI()[0][1] + '</p>' +
                             '</div>' +
                        '</li>' +
                         '<li>' +
                    	    '<p class="ptxtSignin"></p>' +
                            '<div class="txtSigninPopup">' +
                        	      '<div class="div_btnSigninPopup"><a id="btnSIB"  href="Xl_test" class="btnGui">' + langSI()[0][5] + '</a></div>' +
                             '</div>' +
                        '</li>' +
                         '<li class="liLastMess">' +
                    	    '<p class="ptxtSignin"></p>' +
                            '<p class="styleText10 color10 pMessagePUSingin" id="pPopupMess"></p>' +
                        '</li>' +
                    '</ul>' +
                '</div>' +
               '</div>' +
            '</div>' +
         '</div>' +
         '<i class="div_blHelp"></i>' +
        '<i class="div_cbHelp"></i>' +
         '<i class="div_brHelp"></i>' +
         '<div class="div_Close" id="div_CloseWI"></div>' +
        '</div>';
    return strHtml;
}

//edit here 03/11/2011
function showPopupIFOrder(objOrderInfo) {    
    var strStatus = "";
    if (objOrderInfo.TrangThai == "0") {
        strStatus = '<span style="color:#ff6600">' + langOrderInfo()[0][0] + '</span>';
    }
    else if (objOrderInfo.TrangThai == "1") {
        strStatus = '<span style="color:#ff6600">' + langOrderInfo()[0][1] + '</span>';
    }
    else if (objOrderInfo.TrangThai == "2") {
        strStatus = '<span style="color:#ff6600">' + langOrderInfo()[0][2] + '</span>';
    }
    else if (objOrderInfo.TrangThai == "3") {
        strStatus = '<span style="color:#ff6600">' + langOrderInfo()[0][3] + '</span>';
    }
    else if (objOrderInfo.TrangThai == "4") {
        strStatus = '<span style="color:#00ccff">' + langOrderInfo()[0][4] + '</span>';
    }
    var strHTML = "";
    var strHTMLSL = '<div style="margin:0px 0 0 4px" class="div_txtDayDK monthDK">' +
                      '<select autocomplete="off" id="ddlSL_0" style="font-size:15px" name="ddlSL_Order" class="ddlDWBirth">';
                        for (i = 0; i < parseInt(objOrderInfo.SLMua); i++) {
                            strHTMLSL += '<option ' + (objOrderInfo.SoLuong == (i + 1) ? "selected='selected'" : "") + ' value="' + (i + 1) + '" >' + (i + 1) + '</option>';                        
                        }
                        strHTMLSL += '</select>';
                  '</div>';
    strHTML += '<div class="div_bdComment" style="margin:auto;position:relative;">' +
                        '<i class="iTopComentSO"></i>' +
                        '<div class="dBodyComentSO">' +
                            '<i class="iLineTopCM"></i>' +
                            '<div style="padding:30px 0 0 27px">' +
                                '<h1 style="color:#00ccff;font-size:18px;padding-top:5px">' + langOrderInfo()[0][5] + '</h1>' +
                                 '<ul class="ulInfoSO">' +
                                     '<li><span>' + langOrderInfo()[0][6] + '</span><span class="Twodot">:</span><span style="color:#ffffff;width:220px">' + objOrderInfo.HoTen + '</span></li>' +
                                     '<li><span>' + langOrderInfo()[0][7] + '</span><span class="Twodot">:</span><strong>' + objOrderInfo.DiaChi + '</strong></li>' +
                                     '<li><span>' + langOrderInfo()[0][8] + '</span><span class="Twodot">:</span><span style="color:#ffffff">' + objOrderInfo.DienThoai + '</span></li>' +
                                 '</ul>' +
                                 '<div class="infoOrderPU">' +
                                    '<strong class="strSOHD">' + langOrderInfo()[0][9] + ':</strong>' +
                                    '<div class="divMaOrderPU">' +
                                        '<i class="divLOrderPU"></i>' +
                                        '<div class="divBOrderPU">' + objOrderInfo.MaHD + '</div>' +
                                        '<i class="divROrderPU"></i>' +
                                    '</div>' +
                                    '<p class="pTextLSoDH">' + langOrderInfo()[0][10] + ': <span>' + objOrderInfo.NgayMua + '</span></p>' +
                                    '<p class="pTextLSoDH">' + langOrderInfo()[0][11] + ': ' + strStatus + '</p>' +
                                 '</div>' +
                                  '<div style="width:643px;margin:10px 0 0px 0px;float:left;position:relative;">' +
                                  '<i class="iTopLVaDH"></i><i class="iTopRVaDH"></i>' +
                                    '<i class="itopTBDHPU"></i>' +
                                    '<div style="width:641px;border-left:1px solid #999999;border-right:1px solid #999999">' +
                                        '<table cellspacing="0" cellpadding="0" border="0" class="tableOrderPU" style="position:relative;margin-top:-3px;width:641px;">' +
  							                '<tbody>' +
  							                '<tr class="trfirst">' +
  							                 '<th class="thMaHang"   valign="top" align="center">' + langOrderInfo()[0][12] + '</th>' +
    						                 '<th class="th_TenSP"  valign="top" align="left">' + langOrderInfo()[0][13] + '</th>' +
    						                  '<th class="th_SoLuong"  valign="top" align="center">' + langOrderInfo()[0][14] + '</th>' +
   						                     '<th class="th_GiaTien" valign="top" align="center" >' + langOrderInfo()[0][15] + '</th>' +
   						                     '<th class="th_TongCong"  valign="top" align="center">' + langOrderInfo()[0][16] + '</th>' +
  							                '</tr>' +
  							                 '<tr>' +
  							                 '<th class="thMaHang"   valign="top" align="center">' + objOrderInfo.MaHang + '</th>' +
    						                 '<th class="th_TenSP"  valign="top" align="left">' + objOrderInfo.TenHang + '</th>';
                                             if (objOrderInfo.payoo != "True" && strNokiaC7.toString().indexOf("," + objOrderInfo.MaHang + ",") == -1) {
    						                     strHTML += '<th class="th_SoLuong"  valign="top" align="center">' + (objOrderInfo.TrangThai == "1" ? strHTMLSL : objOrderInfo.SoLuong) + '</th>';
    						                 }else{
    						                    strHTML += '<th class="th_SoLuong"  valign="top" align="center">' + objOrderInfo.SoLuong + '</th>';
    						                 }
    						                 strHTML += '<th class="th_GiaTien" valign="top" align="center" >' + objOrderInfo.GiaTien + '</th>' +
   						                     '<th class="th_TongCong"  valign="top" align="center"><span id="spnTongGia">' + objOrderInfo.TongCong + '</span></th>' +
  							                '</tr>' +
  							                '</tbody>' +
  						                '</table>' +
                                    '</div>' +
                                    '<i class="iabLeft"></i><i class="iabRight"></i>' +
                                    '<i class="ibtTBDHPU"></i>' +
                                '</div>';

    						                 //add by Nam 11/05/2011: them phan ma voucher
    						                 if (objOrderInfo.isTravel == "True") {
    						                     Global_objOrderInfo = objOrderInfo;
    						                     strHTML += '<h4 style="font-size:15px;color:#00ccff;padding:10px 0 10px 0;clear:both;cursor:pointer;" onclick="ShowVoucherCode()">' + langOrderInfo()[0][33] + '</h4>';
    						                     strHTML += '<div style="width:305px;margin:10px 0 0px 0px;float:left;position:relative;overflow:hidden;height:0px;display:none" id="dVoucherCode">' +
    						                 '<div id="dVoucherHeight">' +
                                    '<div style="width:300px;border-left:1px solid #999999;border-right:1px solid #999999;border-top:1px solid #999999">' +
                                        '<table cellspacing="0" cellpadding="0" border="0" class="tableOrderPU" style="position:relative;margin-top:-3px;width:300px;;border-bottom:1px solid #999999">' +
  							                '<tbody>' +
  							                '<tr class="trfirst">' +
  							                 '<th class="thMaHang"   valign="top" align="center">STT</th>' +
    						                 '<th class="th_TongCong"  valign="top" align="center">' + langOrderInfo()[0][34] + '</th>' +
  							                '</tr>';
    						                     for (var i = 0; i < (objOrderInfo.SoLuong > 10 ? 10 : objOrderInfo.SoLuong); i++) {
    						                         strHTML += '<tr>';
    						                         if (parseInt(objOrderInfo.MaHang) > 375) {
    						                             strHTML += '<th class="thMaHang"   valign="top" align="center"  style="padding:5px 0px">' + (i + 1) + '</th>';
    						                             strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 0px">' + objOrderInfo.MaHD + "-" + (i + 1) + '</th>';
    						                         }
    						                         else {
    						                             strHTML += '<th class="thMaHang"   valign="top" align="center"  style="padding:5px 10px">' + (i + 1) + '</th>';
    						                             if (i <= 25)
    						                                 strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 10px">' + objOrderInfo.MaHD + " - " + (String.fromCharCode(i + 97).toUpperCase()) + '</th>';
    						                             else
    						                                 strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 10px">' + objOrderInfo.MaHD + " - " + (String.fromCharCode(97).toUpperCase()) + (i - 25) + '</th>';
    						                         }
    						                         strHTML += '</tr>';
    						                     }
    						                     strHTML += '</tbody>' +
  						                '</table>' +
                                    '</div>';
    						                     if (parseInt(objOrderInfo.SoLuong) > 10) {
    						                         var TotalPage = parseInt(objOrderInfo.SoLuong) / 10;
    						                         if ((parseInt(objOrderInfo.SoLuong) % 10) > 0) TotalPage++;
    						                         strHTML += '<div class="dPageLinkMap" style="width:100%">';
    						                         strHTML += '<span>1</span>';
    						                         for (var j = 2; j <= TotalPage; j++) {
    						                             strHTML += '<a onclick="innerVoucherCode(' + j + ')" href="javascript:void()">' + j + '</a>';
    						                         }
    						                         strHTML += '</div>';
    						                     }
    						                     strHTML += '</div></div>';
    						                 }
    						                 //end add by Nam 11/05/2011
    						                 if (objOrderInfo.TrangThai == "1" && objOrderInfo.payoo != "True" && strNokiaC7.toString().indexOf("," + objOrderInfo.MaHang + ",") == -1) {
                                    strHTML += '<em class="pNoteUpdateOS">' + langOrderInfo()[0][25] + ' <strong>' + langOrderInfo()[0][1] + '</strong></em>' +
                                       '<div class="btnHuyOrder">' +
                                            '<div class="dRUpdateOS"><a class="btnGui" onclick="updateStatusOrder()"  href="javascript:void(0)" id="aUpdateOS">' + langOrderInfo()[0][23] + '</a></div>' +
                                            '<div class="dLUpdateOS"><a class="btnGui" onclick="cancelStatusOrder()"  href="javascript:void(0)" id="aCencelOS">' + langOrderInfo()[0][24] + '</a></div>' +
                                            '<p class="pMessUpdateOS styleText10 color10" id="pMessInfo"></p>'+
                                       '</div>';
                               }
                               strHTML += '<p class="pTwoLinePUSO" ></p>' +
                                '<h4 style="font-size:16px;color:#00ccff;padding:30px 0 20px 0;clear:both">' + langOrderInfo()[0][17] + ' <span style="font-size:14px;font-weight:normal">' + langOrderInfo()[0][18] + ':</span></h4>';
                               if (objOrderInfo.TrangThai == "1") {
                                       strHTML += '<span class="spTextCMSO">' + langOrderInfo()[0][19] + ':</span>' +
                                         '<div id = "divAreaCMOrder" class="div_txtDK txtfocus" style="width:570px;float:left;margin:2px 0 0 10px;">' +
                            		        '<i class="txt_tlW"></i>' +
                                	        '<i class="txt_ctW"></i>' +
                                	        '<i class="txt_trW"></i>' +
                                	        '<div class="txt_clW">' +
					                            '<div class="txt_crW">' +
						                            '<div class="txt_inner" style="height:80px;">' +
							                            '<textarea name="textarea" id="textAreaCM" style="width:100%;height:80px;border:0 none;overflow:auto;"  onfocus="focustextArea()" onblur="blurtextArea()"  id="txtCommetSO" ></textarea>' +
						                            '</div>' +
					                            '</div>' +
			                  	            '</div>' +
                                            '<i class="txt_blW"></i>' +
                                            '<i class="txt_cbW"></i>' +
                                            '<i class="txt_brW"></i>' +
                                       ' </div>' +
                                        '<p id="pMessSendCMOrder" class="styleText10 color10" style="clear:both;padding:20px 0 0 70px;float:left;width:410px;"></p>' +
                                   '<div class="btnCheckEWI" id="divbtnSendCMOrder" style="float:left;padding:6px 0 0 40px;position:relative;height:45px;"> <a id="aSendComment" href="javascript:void(0)" onclick="sendCommentOrder()"  class="btnGui">' + langOrderInfo()[0][20] + '</a> </div>'+
                                   '<p class="pPhoneCMST" style="font-size:16px;">';
                               }
                               else {
                                   strHTML += '<span class="spTextCMSO" style="display:none">' + langOrderInfo()[0][19] + ':</span>' +
                                     '<div id = "divAreaCMOrder" class="div_txtDK txtfocus" style="width:570px;float:left;margin:2px 0 0 10px;display:none">' +
                            		    '<i class="txt_tlW"></i>' +
                                	    '<i class="txt_ctW"></i>' +
                                	    '<i class="txt_trW"></i>' +
                                	    '<div class="txt_clW">' +
					                        '<div class="txt_crW">' +
						                        '<div class="txt_inner" style="height:80px;">' +
							                        '<textarea name="textarea" id="textAreaCM" style="width:100%;height:80px;border:0 none;overflow:auto;"  onfocus="focustextArea()" onblur="blurtextArea()"  id="txtCommetSO" ></textarea>' +
						                        '</div>' +
					                        '</div>' +
			                  	        '</div>' +
                                        '<i class="txt_blW"></i>' +
                                        '<i class="txt_cbW"></i>' +
                                        '<i class="txt_brW"></i>' +
                                   ' </div>' +
                                    '<p id="pMessSendCMOrder" class="styleText10 color10" style="clear:both;padding:20px 0 0 70px;float:left;width:410px;display:none"></p>' +
                                '<div class="btnCheckEWI" id="divbtnSendCMOrder" style="float:left;padding:6px 0 0 40px;position:relative;height:45px;display:none"> <a id="aSendComment" href="sssssssss"  class="btnGui">' + langOrderInfo()[0][20] + '</a> </div>' +
                                '<p class="pPhoneCMST" style="font-size:16px;padding-top:0px;">';
                               }
                               strHTML +=  '<span style="color:#ffffff;font-size:16px">' + langOrderInfo()[0][21] + ':</span><span style="font-size:18px"> (08) 7305 6616 - (04) 7305 6616</span> ' + langOrderInfo()[0][22] + '</p>' +
                                '<div class="div_ListCommentWhite" id="div_ListCMOrder" style="width:643px;padding-top:0px;"></div>' +
                                '<div class="divPageOrder" id="divPageCMOrder" style="padding-right:29px;position:relative;"></div>' +
                            '</div>' +
                        '</div>' +
                        '<i class="iBottomComentSO"></i>' +
                        '<div id="div_CloseWI" class="div_Close"></div>' +
              '</div>';
    return strHTML;
}

//add by Nam 11/05/2011

function ShowVoucherCode() {
    if ($("dVoucherCode").offsetHeight == 0) {
        $("dVoucherCode").style.display = "block";
        Show();
    }
    else
        Hide();
}

function Show() {
    var curHeight = parseInt($("dVoucherCode").offsetHeight);
    var VoucherHeight = parseInt($("dVoucherHeight").offsetHeight);
    if (curHeight < VoucherHeight) {
        $("dVoucherCode").style.height = ((curHeight + 20) > VoucherHeight ? VoucherHeight : (curHeight + 20)) + "px";
        t1 = setTimeout("Show()", 20);
    } else {
        clearTimeout(t1);
    }


}

function Hide() {
    var curHeight = parseInt($("dVoucherCode").offsetHeight);
    if (curHeight > 0) {
        $("dVoucherCode").style.height = ((curHeight - 20) < 0 ? 0 : (curHeight - 20)) + "px";
        t2 = setTimeout("Hide()", 20);
    } else {
        clearTimeout(t2);
    }
}
var Global_objOrderInfo;
function innerVoucherCode(Page) {
    var objOrderInfo = Global_objOrderInfo;
    var code = "";
    var strHTML = '<div style="width:300px;border-left:1px solid #999999;border-right:1px solid #999999;border-top:1px solid #999999;border-bottom:1px solid #999999">' +
                                        '<table cellspacing="0" cellpadding="0" border="0" class="tableOrderPU" style="position:relative;margin-top:-3px;width:300px;">' +
  							                '<tbody>' +
  							                '<tr class="trfirst">' +
  							                 '<th class="thMaHang"   valign="top" align="center">STT</th>' +
    						                 '<th class="th_TongCong"  valign="top" align="center">Mã voucher</th>' +
  							                '</tr>';
    for (var i = (Page * 10) - 10; i < (objOrderInfo.SoLuong > (Page * 10) ? (Page * 10) : objOrderInfo.SoLuong); i++) {
        strHTML += '<tr>';
        if (parseInt(objOrderInfo.MaHang) > 375) {
            strHTML += '<th class="thMaHang"   valign="top" align="center"  style="padding:5px 0px">' + (i + 1) + '</th>';
            strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 0px">' + objOrderInfo.MaHD + "-" + (i + 1) + '</th>';
        }
        else {
            strHTML += '<th class="thMaHang"   valign="top" align="center"  style="padding:5px 10px">' + (i + 1) + '</th>';
            if (i > 25) code = parseInt(i / 26);
            strHTML += '<th class="th_TongCong"  valign="top" align="left" style="padding:5px 10px">' + objOrderInfo.MaHD + " - " + (String.fromCharCode(i % 26 + 97).toUpperCase()) + code + '</th>';

        }
        strHTML += '</tr>';

    }


    strHTML += '</tbody>' +
  						                '</table>' +
                                    '</div>';

    if (parseInt(objOrderInfo.SoLuong) > 10) {
        var TotalPage = parseInt(objOrderInfo.SoLuong) / 10;
        if ((parseInt(objOrderInfo.SoLuong) % 10) > 0) TotalPage++;
        strHTML += '<div class="dPageLinkMap" style="width:100%">';
        for (var j = 1; j <= TotalPage; j++) {
            if (j != Page)
                strHTML += '<a onclick="innerVoucherCode(' + j + ')" href="javascript:void()">' + j + '</a>';
            else
                strHTML += '<span>' + j + '</span>';
        }
        strHTML += '</div>';
    }
    $("dVoucherHeight").innerHTML = strHTML;

}

//end add by Nam 11/05/2011
//add by nam 26/5/2011
function ShowPopup2Read() {
    var strHTML = "";
    strHTML += '<div style="display: block;width:440px;_width:425px;" class="box viewfull" id="box">' +
        '<i class="box_tl"></i>' +
        '<i class="box_tc"></i>' +
        '<i class="box_tr"></i>' +
        '<div class="box_cl">' +
            '<div class="box_cr">' +
                '<div class="box_inner box_innerLS" style="height:500px; overflow-y:auto; background-color:#fff;" id="box_inner" >  ' +
                   '<div id="music_title" style="background-color:#323232;padding:2px 0;"></div>' +
                   '<div style="width:400px; height:300px;background-image:url(player/yume.jpg)"></div>' +
                   '<div id="flash_player" style="background-color:#323232;padding:5px 0;width:400px;">' +
                   '</div>' +


                '</div>' +
            '</div>' +
        '</div>' +
        '<i class="box_bl"></i>' +
        '<i class="box_bc"></i>' +
        '<i class="box_br"></i>' +
        '<div id="div_CloseWI" class="div_Close" onclick="ClosePopupPhoto()"></div>' +
     '</div>';
    return strHTML;
}
//end add by nam 26/5/2011